﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using log4net;
using DWH.Data;

namespace DWH.PP
{
    public abstract class PPTaskBase
    {
        public bool Enable { get; set; }
                
        public string TaskName { get; set; }

        public Dictionary<string, string> ExtendData { get; set; }
        public Dictionary<string, string> PPTaskResumeData { get; private set; }

        public abstract void Initialize();
        public abstract void Run();
        public abstract void Reset();
            
        public PPTaskBase()
        {
            
        }

        protected void InitializeTaskInfoFromDB()
        {
            DWHDBHelper.PushTaskToDB(TaskName);

            PPTaskResumeData = DWHDBHelper.GetPPTaskResumeData(TaskName);

            if (PPTaskResumeData == null)
            {
                PPTaskResumeData = new Dictionary<string, string>();
            }
        }
    }
}
